﻿using System.Collections.Generic;
using System.Linq;

namespace Inscriptionem.Areas.Inscriptionem.Models.Views
{
    public class ContactSearchCollectionViewModel
    {
        public IEnumerable<ORM.ContactRequest> Contacts { get; protected set; }

        public ContactSearchCollectionViewModel()
        {
            Contacts = new ORM.DB().ContactRequests.Where(cr => !cr.IsDeleted && cr.Message.ToLower().Contains(Text.ToLower())).OrderBy(cr => cr.ID);
        }

        public string Text { get; set; }
        public int Page { get; set; }
    }
}